package bookstudytest.singleton;

/**
 * @Auther: Lee
 * @Date: 2018/6/11 14:40
 * @Description: 饿汉式单例模式 类加载时就保存一个实例对象
 */
public class HungerDemo {
    private HungerDemo() {
        System.out.println("我好了，你呢？");
    }

    private static final HungerDemo HUNGER_DEMO = new HungerDemo();

    public static HungerDemo getInstance() {
        return HUNGER_DEMO;
    }
}
